﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Text;

namespace Dot5Demo.MarkDowngm
{

    public class MarkDownDoc
    {
        public const string CssTemplate = "<style type=\"text/css\">{0}</style>";
        public const string htmlTemplate1 = @"<!DOCTYPE html><head><meta http-equiv=""X-UA-Compatible"" content=""IE=edge"">{0}</head><body>{1}</body></html>";
        public const string htmlTemplate2 = "<!DOCTYPE html><head></head><body>{0}</body></html>";

        public const string MathScript = @"
<script type=""text/javascript"" src=""http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML""></script>
<script type = ""text/x-mathjax-config"" >
    MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: ""none"" });
</script>
";

        public static string WrapHtmlText(string htmlText, params string[] cssStrs)
        {
            var ret = "";
            var css = new StringBuilder();
            if (cssStrs != null)
            {
                for (int i = 0; i < cssStrs.Length; i++)
                {
                    css.AppendLine(string.Format(CssTemplate, cssStrs[i]));
                }
            }
            css.AppendLine(MarkDown.CSSConsts.KatexScript);
            ret = string.Format(htmlTemplate1, css.ToString(), htmlText);
            return ret;
        }
    }


    public enum Alignment
    {
        Left = 0,
        Center = 1,
        Right = 2,
    }
}